home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Tools 5
/
Amiga Tools 5.iso
/
tools
/
developer-tools
/
andere sprachen
/
perl5
/
man
/
catp
/
perlform.0
< prev
next >
Wrap
Text File
|
1996-03-02
|
30KB
|
463 lines
PERLFORM(1) User Contributed Perl Documentation PERLFORM(1)
NNNNAAAAMMMMEEEE
perlform - Perl formats
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
Perl has a mechanism to help you generate simple reports
and charts. To facilitate this, Perl helps you code up
your output page close to how it will look when it's
printed. It can keep track of things like how many lines
on a page, what page you're on, when to print page
headers, etc. Keywords are borrowed from FORTRAN:
_f_o_r_m_a_t_(_) to declare and _w_r_i_t_e_(_) to execute; see their
entries in the _p_e_r_l_f_u_n_c manpage. Fortunately, the layout
is much more legible, more like BASIC's PRINT USING
statement. Think of it as a poor man's _n_r_o_f_f(1).
Formats, like packages and subroutines, are declared
rather than executed, so they may occur at any point in
your program. (Usually it's best to keep them all
together though.) They have their own namespace apart from
all the other "types" in Perl. This means that if you
have a function named "Foo", it is not the same thing as
having a format named "Foo". However, the default name
for the format associated with a given filehandle is the
same as the name of the filehandle. Thus, the default
format for STDOUT is name "STDOUT", and the default format
for filehandle TEMP is name "TEMP". They just look the
same. They aren't.
Output record formats are declared as follows:
ffffoooorrrrmmmmaaaatttt NNNNAAAAMMMMEEEE ====
FFFFOOOORRRRMMMMLLLLIIIISSSSTTTT
....
If name is omitted, format "STDOUT" is defined. FORMLIST
consists of a sequence of lines, each of which may be of
one of three types:
1. A comment, indicated by putting a '#' in the first
column.
2. A "picture" line giving the format for one output
line.
3. An argument line supplying values to plug into the
previous picture line.
Picture lines are printed exactly as they look, except for
certain fields that substitute values into the line. Each
field in a picture line starts with either "@" (at) or "^"
(caret). These lines do not undergo any kind of variable
interpolation. The at field (not to be confused with the
array marker @) is the normal kind of field; the other
kind, caret fields, are used to do rudimentary multi-line
30/Jan/96 perl 5.002 with 1
PERLFORM(1) User Contributed Perl Documentation PERLFORM(1)
text block filling. The length of the field is supplied
by padding out the field with multiple "<", ">", or "|"
characters to specify, respectively, left justification,
right justification, or centering. If the variable would
exceed the width specified, it is truncated.
As an alternate form of right justification, you may also
use "#" characters (with an optional ".") to specify a
numeric field. This way you can line up the decimal
points. If any value supplied for these fields contains a
newline, only the text up to the newline is printed.
Finally, the special field "@*" can be used for printing
multi-line, non-truncated values; it should appear by
itself on a line.
The values are specified on the following line in the same
order as the picture fields. The expressions providing
the values should be separated by commas. The expressions
are all evaluated in a list context before the line is
processed, so a single list expression could produce
multiple list elements. The expressions may be spread out
to more than one line if enclosed in braces. If so, the
opening brace must be the first token on the first line.
Picture fields that begin with ^ rather than @ are treated
specially. With a # field, the field is blanked out if
the value is undefined. For other field types, the caret
enables a kind of fill mode. Instead of an arbitrary
expression, the value supplied must be a scalar variable
name that contains a text string. Perl puts as much text
as it can into the field, and then chops off the front of
the string so that the next time the variable is
referenced, more of the text can be printed. (Yes, this
means that the variable itself is altered during execution
of the _w_r_i_t_e_(_) call, and is not returned.) Normally you
would use a sequence of fields in a vertical stack to
print out a block of text. You might wish to end the
final field with the text "...", which will appear in the
output if the text was too long to appear in its entirety.
You can change which characters are legal to break on by
changing the variable $$$$:::: (that's
$$$$FFFFOOOORRRRMMMMAAAATTTT____LLLLIIIINNNNEEEE____BBBBRRRREEEEAAAAKKKK____CCCCHHHHAAAARRRRAAAACCCCTTTTEEEERRRRSSSS if you're using the English
module) to a list of the desired characters.
Using caret fields can produce variable length records.
If the text to be formatted is short, you can suppress
blank lines by putting a "~" (tilde) character anywhere in
the line. The tilde will be translated to a space upon
output. If you put a second tilde contiguous to the
first, the line will be repeated until all the fields on
the line are exhausted. (If you use a field of the at
variety, the expression you supply had better not give the
same value every time forever!)
30/Jan/96 perl 5.002 with 2
PERLFORM(1) User Contributed Perl Documentation PERLFORM(1)
Top-of-form processing is by default handled by a format
with the same name as the current filehandle with "_TOP"
concatenated to it. It's triggered at the top of each
page. See <perlfunc/_w_r_i_t_e_(_)>.
Examples:
#### aaaa rrrreeeeppppoooorrrrtttt oooonnnn tttthhhheeee ////eeeettttcccc////ppppaaaasssssssswwwwdddd ffffiiiilllleeee
ffffoooorrrrmmmmaaaatttt SSSSTTTTDDDDOOOOUUUUTTTT____TTTTOOOOPPPP ====
PPPPaaaasssssssswwwwdddd FFFFiiiilllleeee
NNNNaaaammmmeeee LLLLooooggggiiiinnnn OOOOffffffffiiiicccceeee UUUUiiiidddd GGGGiiiidddd HHHHoooommmmeeee
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
....
ffffoooorrrrmmmmaaaatttt SSSSTTTTDDDDOOOOUUUUTTTT ====
@@@@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @@@@|||||||||||||||||||||||||||| @@@@<<<<<<<<<<<<<<<<<<<<<<<<@@@@>>>>>>>>>>>>>>>> @@@@>>>>>>>>>>>>>>>> @@@@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$$$$nnnnaaaammmmeeee,,,, $$$$llllooooggggiiiinnnn,,,, $$$$ooooffffffffiiiicccceeee,,,,$$$$uuuuiiiidddd,,,,$$$$ggggiiiidddd,,,, $$$$hhhhoooommmmeeee
....
#### aaaa rrrreeeeppppoooorrrrtttt ffffrrrroooommmm aaaa bbbbuuuugggg rrrreeeeppppoooorrrrtttt ffffoooorrrrmmmm
ffffoooorrrrmmmmaaaatttt SSSSTTTTDDDDOOOOUUUUTTTT____TTTTOOOOPPPP ====
BBBBuuuugggg RRRReeeeppppoooorrrrttttssss
@@@@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @@@@|||||||||||| @@@@>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$$$$ssssyyyysssstttteeeemmmm,,,, $$$$%%%%,,,, $$$$ddddaaaatttteeee
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
....
ffffoooorrrrmmmmaaaatttt SSSSTTTTDDDDOOOOUUUUTTTT ====
SSSSuuuubbbbjjjjeeeecccctttt:::: @@@@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$$$$ssssuuuubbbbjjjjeeeecccctttt
IIIInnnnddddeeeexxxx:::: @@@@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$$$$iiiinnnnddddeeeexxxx,,,, $$$$ddddeeeessssccccrrrriiiippppttttiiiioooonnnn
PPPPrrrriiiioooorrrriiiittttyyyy:::: @@@@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< DDDDaaaatttteeee:::: @@@@<<<<<<<<<<<<<<<<<<<<<<<<<<<< ^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$$$$pppprrrriiiioooorrrriiiittttyyyy,,,, $$$$ddddaaaatttteeee,,,, $$$$ddddeeeessssccccrrrriiiippppttttiiiioooonnnn
FFFFrrrroooommmm:::: @@@@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$$$$ffffrrrroooommmm,,,, $$$$ddddeeeessssccccrrrriiiippppttttiiiioooonnnn
AAAAssssssssiiiiggggnnnneeeedddd ttttoooo:::: @@@@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$$$$pppprrrrooooggggrrrraaaammmmmmmmeeeerrrr,,,, $$$$ddddeeeessssccccrrrriiiippppttttiiiioooonnnn
~~~~ ^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$$$$ddddeeeessssccccrrrriiiippppttttiiiioooonnnn
~~~~ ^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$$$$ddddeeeessssccccrrrriiiippppttttiiiioooonnnn
~~~~ ^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$$$$ddddeeeessssccccrrrriiiippppttttiiiioooonnnn
~~~~ ^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$$$$ddddeeeessssccccrrrriiiippppttttiiiioooonnnn
~~~~ ^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<............
$$$$ddddeeeessssccccrrrriiiippppttttiiiioooonnnn
....
It is possible to intermix _p_r_i_n_t_(_)s with _w_r_i_t_e_(_)s on the
same output channel, but you'll have to handle $-
($FORMAT_LINES_LEFT) yourself.
30/Jan/96 perl 5.002 with 3
PERLFORM(1) User Contributed Perl Documentation PERLFORM(1)
FFFFoooorrrrmmmmaaaatttt VVVVaaaarrrriiiiaaaabbbblllleeeessss
The current format name is stored in the variable $$$$~~~~
($FORMAT_NAME), and the current top of form format name is
in $$$$^^^^ ($FORMAT_TOP_NAME). The current output page number
is stored in $$$$%%%% ($FORMAT_PAGE_NUMBER), and the number of
lines on the page is in $$$$==== ($FORMAT_LINES_PER_PAGE).
Whether to autoflush output on this handle is stored in $$$$||||
($OUTPUT_AUTOFLUSH). The string output before each top of
page (except the first) is stored in $$$$^^^^LLLL
($FORMAT_FORMFEED). These variables are set on a per-
filehandle basis, so you'll need to _s_e_l_e_c_t_(_) into a
different one to affect them:
sssseeeelllleeeecccctttt((((((((sssseeeelllleeeecccctttt((((OOOOUUUUTTTTFFFF)))),,,,
$$$$~~~~ ==== """"MMMMyyyy____OOOOtttthhhheeeerrrr____FFFFoooorrrrmmmmaaaatttt"""",,,,
$$$$^^^^ ==== """"MMMMyyyy____TTTToooopppp____FFFFoooorrrrmmmmaaaatttt""""
))))[[[[0000]]]]))));;;;
Pretty ugly, eh? It's a common idiom though, so don't be
too surprised when you see it. You can at least use a
temporary variable to hold the previous filehandle: (this
is a much better approach in general, because not only
does legibility improve, you now have intermediary stage
in the expression to single-step the debugger through):
$$$$ooooffffhhhh ==== sssseeeelllleeeecccctttt((((OOOOUUUUTTTTFFFF))));;;;
$$$$~~~~ ==== """"MMMMyyyy____OOOOtttthhhheeeerrrr____FFFFoooorrrrmmmmaaaatttt"""";;;;
$$$$^^^^ ==== """"MMMMyyyy____TTTToooopppp____FFFFoooorrrrmmmmaaaatttt"""";;;;
sssseeeelllleeeecccctttt(((($$$$ooooffffhhhh))));;;;
If you use the English module, you can even read the
variable names:
uuuusssseeee EEEEnnnngggglllliiiisssshhhh;;;;
$$$$ooooffffhhhh ==== sssseeeelllleeeecccctttt((((OOOOUUUUTTTTFFFF))));;;;
$$$$FFFFOOOORRRRMMMMAAAATTTT____NNNNAAAAMMMMEEEE ==== """"MMMMyyyy____OOOOtttthhhheeeerrrr____FFFFoooorrrrmmmmaaaatttt"""";;;;
$$$$FFFFOOOORRRRMMMMAAAATTTT____TTTTOOOOPPPP____NNNNAAAAMMMMEEEE ==== """"MMMMyyyy____TTTToooopppp____FFFFoooorrrrmmmmaaaatttt"""";;;;
sssseeeelllleeeecccctttt(((($$$$ooooffffhhhh))));;;;
But you still have those funny _s_e_l_e_c_t_(_)s. So just use the
FileHandle module. Now, you can access these special
variables using lower-case method names instead:
uuuusssseeee FFFFiiiilllleeeeHHHHaaaannnnddddlllleeee;;;;
ffffoooorrrrmmmmaaaatttt____nnnnaaaammmmeeee OOOOUUUUTTTTFFFF """"MMMMyyyy____OOOOtttthhhheeeerrrr____FFFFoooorrrrmmmmaaaatttt"""";;;;
ffffoooorrrrmmmmaaaatttt____ttttoooopppp____nnnnaaaammmmeeee OOOOUUUUTTTTFFFF """"MMMMyyyy____TTTToooopppp____FFFFoooorrrrmmmmaaaatttt"""";;;;
Much better!
NNNNOOOOTTTTEEEESSSS
Since the values line may contain arbitrary expressions
(for at fields, not caret fields), you can farm out more
sophisticated processing to other functions, like
30/Jan/96 perl 5.002 with 4
PERLFORM(1) User Contributed Perl Documentation PERLFORM(1)
_s_p_r_i_n_t_f_(_) or one of your own. For example:
ffffoooorrrrmmmmaaaatttt IIIIddddeeeennnntttt ====
@@@@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
&&&&ccccoooommmmmmmmiiiiffffyyyy(((($$$$nnnn))))
....
To get a real at or caret into the field, do this:
ffffoooorrrrmmmmaaaatttt IIIIddddeeeennnntttt ====
IIII hhhhaaaavvvveeee aaaannnn @@@@ hhhheeeerrrreeee....
""""@@@@""""
....
To center a whole line of text, do something like this:
ffffoooorrrrmmmmaaaatttt IIIIddddeeeennnntttt ====
@@@@||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
""""SSSSoooommmmeeee tttteeeexxxxtttt lllliiiinnnneeee""""
....
There is no builtin way to say "float this to the right
hand side of the page, however wide it is." You have to
specify where it goes. The truly desperate can generate
their own format on the fly, based on the current number
of columns, and then _e_v_a_l_(_) it:
$$$$ffffoooorrrrmmmmaaaatttt ==== """"ffffoooorrrrmmmmaaaatttt SSSSTTTTDDDDOOOOUUUUTTTT ==== \\\\nnnn"""";;;;
.... ''''^^^^'''' .... ''''<<<<'''' xxxx $$$$ccccoooollllssss .... """"\\\\nnnn"""";;;;
.... ''''$$$$eeeennnnttttrrrryyyy'''' .... """"\\\\nnnn"""";;;;
.... """"\\\\tttt^^^^"""" .... """"<<<<"""" xxxx (((($$$$ccccoooollllssss----8888)))) .... """"~~~~~~~~\\\\nnnn"""";;;;
.... ''''$$$$eeeennnnttttrrrryyyy'''' .... """"\\\\nnnn"""";;;;
.... """"....\\\\nnnn"""";;;;
pppprrrriiiinnnntttt $$$$ffffoooorrrrmmmmaaaatttt iiiiffff $$$$DDDDeeeebbbbuuuuggggggggiiiinnnngggg;;;;
eeeevvvvaaaallll $$$$ffffoooorrrrmmmmaaaatttt;;;;
ddddiiiieeee $$$$@@@@ iiiiffff $$$$@@@@;;;;
Which would generate a format looking something like this:
ffffoooorrrrmmmmaaaatttt SSSSTTTTDDDDOOOOUUUUTTTT ====
^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$$$$eeeennnnttttrrrryyyy
^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~~~~~~~
$$$$eeeennnnttttrrrryyyy
....
Here's a little program that's somewhat like _f_m_t(1):
ffffoooorrrrmmmmaaaatttt ====
^^^^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~~~~~~~
$$$$____
....
30/Jan/96 perl 5.002 with 5
PERLFORM(1) User Contributed Perl Documentation PERLFORM(1)
$$$$//// ==== '''''''';;;;
wwwwhhhhiiiilllleeee ((((<<<<>>>>)))) {{{{
ssss////\\\\ssss****\\\\nnnn\\\\ssss****//// ////gggg;;;;
wwwwrrrriiiitttteeee;;;;
}}}}
FFFFooooooootttteeeerrrrssss
While $$$$FFFFOOOORRRRMMMMAAAATTTT____TTTTOOOOPPPP____NNNNAAAAMMMMEEEE contains the name of the current
header format, there is no corresponding mechanism to
automatically do the same thing for a footer. Not knowing
how big a format is going to be until you evaluate it is
one of the major problems. It's on the TODO list.
Here's one strategy: If you have a fixed-size footer, you
can get footers by checking $$$$FFFFOOOORRRRMMMMAAAATTTT____LLLLIIIINNNNEEEESSSS____LLLLEEEEFFFFTTTT before each
_w_r_i_t_e_(_) and print the footer yourself if necessary.
Here's another strategy; open a pipe to yourself, using
ooooppppeeeennnn((((MMMMEEEESSSSEEEELLLLFFFF,,,, """"||||----"""")))) (see the ooooppppeeeennnn(((()))) entry in the _p_e_r_l_f_u_n_c
manpage) and always _w_r_i_t_e_(_) to MESELF instead of STDOUT.
Have your child process postprocesses its STDIN to
rearrange headers and footers however you like. Not very
convenient, but doable.
AAAAcccccccceeeessssssssiiiinnnngggg FFFFoooorrrrmmmmaaaattttttttiiiinnnngggg IIIInnnntttteeeerrrrnnnnaaaallllssss
For low-level access to the formatting mechanism. you may
use _f_o_r_m_l_i_n_e_(_) and access $$$$^^^^AAAA (the $$$$AAAACCCCCCCCUUUUMMMMUUUULLLLAAAATTTTOOOORRRR variable)
directly.
For example:
$$$$ssssttttrrrr ==== ffffoooorrrrmmmmlllliiiinnnneeee <<<<<<<<''''EEEENNNNDDDD'''',,,, 1111,,,,2222,,,,3333;;;;
@@@@<<<<<<<<<<<< @@@@|||||||||||| @@@@>>>>>>>>>>>>
EEEENNNNDDDD
pppprrrriiiinnnntttt """"WWWWoooowwww,,,, IIII jjjjuuuusssstttt ssssttttoooorrrreeeedddd ````$$$$^^^^AAAA'''' iiiinnnn tttthhhheeee aaaaccccccccuuuummmmuuuullllaaaattttoooorrrr!!!!\\\\nnnn"""";;;;
Or to make an _s_w_r_i_t_e_(_) subroutine which is to _w_r_i_t_e_(_) what
_s_p_r_i_n_t_f_(_) is to _p_r_i_n_t_f_(_), do this:
uuuusssseeee CCCCaaaarrrrpppp;;;;
ssssuuuubbbb sssswwwwrrrriiiitttteeee {{{{
ccccrrrrooooaaaakkkk """"uuuussssaaaaggggeeee:::: sssswwwwrrrriiiitttteeee PPPPIIIICCCCTTTTUUUURRRREEEE AAAARRRRGGGGSSSS"""" uuuunnnnlllleeeessssssss @@@@____;;;;
mmmmyyyy $$$$ffffoooorrrrmmmmaaaatttt ==== sssshhhhiiiifffftttt;;;;
$$$$^^^^AAAA ==== """""""";;;;
ffffoooorrrrmmmmlllliiiinnnneeee(((($$$$ffffoooorrrrmmmmaaaatttt,,,,@@@@____))));;;;
rrrreeeettttuuuurrrrnnnn $$$$^^^^AAAA;;;;
}}}}
30/Jan/96 perl 5.002 with 6
PERLFORM(1) User Contributed Perl Documentation PERLFORM(1)
$$$$ssssttttrrrriiiinnnngggg ==== sssswwwwrrrriiiitttteeee((((<<<<<<<<''''EEEENNNNDDDD'''',,,, 1111,,,, 2222,,,, 3333))));;;;
CCCChhhheeeecccckkkk mmmmeeee oooouuuutttt
@@@@<<<<<<<<<<<< @@@@|||||||||||| @@@@>>>>>>>>>>>>
EEEENNNNDDDD
pppprrrriiiinnnntttt $$$$ssssttttrrrriiiinnnngggg;;;;
WWWWAAAARRRRNNNNIIIINNNNGGGG
Lexical variables (declared with "my") are not visible
within a format unless the format is declared within the
scope of the lexical variable. (They weren't visible at
all before version 5.001.) Furthermore, lexical aliases
will not be compiled correctly: see the mmmmyyyy entry in the
_p_e_r_l_f_u_n_c manpage for other issues.
30/Jan/96 perl 5.002 with 7